package com.javasea.scene.code.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.javasea.scene.code.service.UserService;
import com.javasea.scene.code.entity.User;
import com.javasea.scene.code.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author longxiaonan@163.com
 * @Date 2019/9/3 0003 0:32
 */
@Service
public class CommonUserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public User findUserByName(String name) {
        return userMapper.findUserByName(name);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Long nextSequence(){
        Long aLong = userMapper.nextSequence();
        int i = 1/0;
        return aLong;
    }
}
